#ifndef									__ROTATINGBUFFER_H__
#	define								__ROTATINGBUFFER_H__

#	include								"IRotatingBuffer.h"
#	include								<QMutex>
#	include								<vector>

class									RotatingBuffer : public IRotatingBuffer
{
public:
	RotatingBuffer(int);
	virtual ~RotatingBuffer();

private:
	std::vector<byte>					_data;
	int									_read;
	int									_write;
	size_t								_capacity;
	QMutex								_mutex;

public:
	virtual void						init();
	virtual byte						read();
	virtual void						write(byte);
	virtual bool						empty();
	virtual int							size();
	virtual int							capacity();
	virtual byte						operator[](size_t);
};

#endif									// !__ROTATINGBUFFER_H__
